package com.own.demo.长沙空中路网格子.Thread;

import com.alibaba.fastjson.JSONObject;
import com.own.demo.utils.DateUtils;
import com.own.demo.writerfile.WriterFileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Date;

/**
 * 线程启用接口
 *
 * @author heguanglong
 * @date 2023/6/13
 */
public class 所有格子 implements Runnable {
    private static Logger log = LoggerFactory.getLogger(所有格子.class);
    JSONObject jsonObject;
    private String urlAll;
    public 所有格子(JSONObject jsonObject, String url) {
      this.jsonObject=jsonObject;
      this.urlAll=url;
    }

    @Override
    public void run() {

        try {
            System.out.println(DateUtils.parseDateToStr(new Date())+" 所有格子JSONObject");
            WriterFileUtils.writerFoFile(JSONObject.toJSONString(jsonObject),urlAll,"//所有格子JSONObject-"+DateUtils.getNewDateSs()+".json");
            System.out.println(DateUtils.parseDateToStr(new Date())+" 所有格子JSONObject完成");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
